<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>beagleoncreate: Gpio Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">beagleoncreate
   
   </div>
   <div id="projectbrief">Beagleboard sensor interface on iRobot Create with sonar and USB webcam through WiFi</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('class_gpio.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">Gpio Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="Gpio" -->
<p>This class is the class to handle any gpio related actions.  
 <a href="class_gpio.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_gpio_8h_source.html">Gpio.h</a>&gt;</code></p>

<p><a href="class_gpio-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_gpio.html#a5b18c988a3c1d2a4c1581f2b299c3b84">Gpio</a> (unsigned int pinNum, bool isOut=true)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">A constructor for <a class="el" href="class_gpio.html" title="This class is the class to handle any gpio related actions.">Gpio</a> class. Also export the port in the constructor.  <a href="#a5b18c988a3c1d2a4c1581f2b299c3b84"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a08d5f1b18ad260f1812706057b14ee0e"></a><!-- doxytag: member="Gpio::~Gpio" ref="a08d5f1b18ad260f1812706057b14ee0e" args="()" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_gpio.html#a08d5f1b18ad260f1812706057b14ee0e">~Gpio</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">A destructor for <a class="el" href="class_gpio.html" title="This class is the class to handle any gpio related actions.">Gpio</a> class. Unexport here. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_gpio.html#a81b3ac6027516e2d64d68d56a5bfdcfd">GetValue</a> (<a class="el" href="_gpio_8h.html#af85a50a6f2ad829c847ac5250c40b0c1">GpioVal</a> &amp;value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the gpio pin value when the pin is in input mode.  <a href="#a81b3ac6027516e2d64d68d56a5bfdcfd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_gpio.html#a7bab06d29120f9b6d724429fcac167d2">SetEdge</a> (<a class="el" href="_gpio_8h.html#a5d25b5873c978e7acc8ad1a380cbc165">GpioEdge</a> edge)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the trigger edge when the gpio is in input mode.  <a href="#a7bab06d29120f9b6d724429fcac167d2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_gpio.html#a9cd5e02f4ea1cb55ce6165e921012041">SetValue</a> (<a class="el" href="_gpio_8h.html#af85a50a6f2ad829c847ac5250c40b0c1">GpioVal</a> value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the gpio pin value when the gpio pin is in output mode.  <a href="#a9cd5e02f4ea1cb55ce6165e921012041"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_gpio.html#a1d3e66e5ef3d40de97d06d4ced6849a5">SetDir</a> (bool out)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the gpio pin direction.  <a href="#a1d3e66e5ef3d40de97d06d4ced6849a5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_gpio.html#a3dbc162200988c245e3ed85fa5db3b5a">Poll</a> (int usec, struct timespec &amp;timeOfInterrupt)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Polling the gpio input and record the time when the trigger occurred.  <a href="#a3dbc162200988c245e3ed85fa5db3b5a"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>This class is the class to handle any gpio related actions. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a5b18c988a3c1d2a4c1581f2b299c3b84"></a><!-- doxytag: member="Gpio::Gpio" ref="a5b18c988a3c1d2a4c1581f2b299c3b84" args="(unsigned int pinNum, bool isOut=true)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_gpio.html#a5b18c988a3c1d2a4c1581f2b299c3b84">Gpio::Gpio</a> </td>
          <td>(</td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>pinNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>isOut</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>A constructor for <a class="el" href="class_gpio.html" title="This class is the class to handle any gpio related actions.">Gpio</a> class. Also export the port in the constructor. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pinNum</td><td>the pin number for the gpio. </td></tr>
    <tr><td class="paramname">isOut</td><td>true if the gpio is initalized as output. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a81b3ac6027516e2d64d68d56a5bfdcfd"></a><!-- doxytag: member="Gpio::GetValue" ref="a81b3ac6027516e2d64d68d56a5bfdcfd" args="(GpioVal &amp;value)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_gpio.html#a81b3ac6027516e2d64d68d56a5bfdcfd">Gpio::GetValue</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_gpio_8h.html#af85a50a6f2ad829c847ac5250c40b0c1">GpioVal</a> &amp;&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the gpio pin value when the pin is in input mode. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>The value HIGH or LOW of the gpio input reading. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on fail. </dd></dl>

</div>
</div>
<a class="anchor" id="a3dbc162200988c245e3ed85fa5db3b5a"></a><!-- doxytag: member="Gpio::Poll" ref="a3dbc162200988c245e3ed85fa5db3b5a" args="(int usec, struct timespec &amp;timeOfInterrupt)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_gpio.html#a3dbc162200988c245e3ed85fa5db3b5a">Gpio::Poll</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>usec</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct timespec &amp;&#160;</td>
          <td class="paramname"><em>timeOfInterrupt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Polling the gpio input and record the time when the trigger occurred. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">usec</td><td>The timeout periold for polling in microsecond. </td></tr>
    <tr><td class="paramname">timeOfInterrupt</td><td>The recorded time when the triggering occurred. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if the timeout occurred, &gt; 0 if triggering happened, -1 if something went wrong. </dd></dl>

</div>
</div>
<a class="anchor" id="a1d3e66e5ef3d40de97d06d4ced6849a5"></a><!-- doxytag: member="Gpio::SetDir" ref="a1d3e66e5ef3d40de97d06d4ced6849a5" args="(bool out)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_gpio.html#a1d3e66e5ef3d40de97d06d4ced6849a5">Gpio::SetDir</a> </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>out</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set the gpio pin direction. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">out</td><td>True if wants to set the pin as an output. False otherwise. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on fail. </dd></dl>

</div>
</div>
<a class="anchor" id="a7bab06d29120f9b6d724429fcac167d2"></a><!-- doxytag: member="Gpio::SetEdge" ref="a7bab06d29120f9b6d724429fcac167d2" args="(GpioEdge edge)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_gpio.html#a7bab06d29120f9b6d724429fcac167d2">Gpio::SetEdge</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_gpio_8h.html#a5d25b5873c978e7acc8ad1a380cbc165">GpioEdge</a>&#160;</td>
          <td class="paramname"><em>edge</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set the trigger edge when the gpio is in input mode. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">edge</td><td>RISING, FALLING, or BOTH. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on fail. </dd></dl>

</div>
</div>
<a class="anchor" id="a9cd5e02f4ea1cb55ce6165e921012041"></a><!-- doxytag: member="Gpio::SetValue" ref="a9cd5e02f4ea1cb55ce6165e921012041" args="(GpioVal value)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_gpio.html#a9cd5e02f4ea1cb55ce6165e921012041">Gpio::SetValue</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_gpio_8h.html#af85a50a6f2ad829c847ac5250c40b0c1">GpioVal</a>&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set the gpio pin value when the gpio pin is in output mode. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>HIGH or LOW. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on fail. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/backups/Desktop/beagleoncreate/trunk/sonar/<a class="el" href="_gpio_8h_source.html">Gpio.h</a></li>
<li>D:/backups/Desktop/beagleoncreate/trunk/sonar/<a class="el" href="_gpio_8cpp.html">Gpio.cpp</a></li>
</ul>
</div><!-- contents -->
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="class_gpio.html">Gpio</a>      </li>

    <li class="footer">Generated on Sun Feb 12 2012 18:23:34 for beagleoncreate by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
